home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #11
/
Amiga Plus CD - 2004 - No. 11.iso
/
AmiSoft
/
Dev
/
basic
/
blitzgtfix.lha
/
BlitzGTFix
/
BBGTLib_Examples
/
gtchangelist.bb2
< prev
next >
Wrap
Text File
|
2002-01-30
|
1KB
|
53 lines
WbToScreen 3
Use Screen 3
LoadFont 2,"topaz.font",8
Use IntuiFont 2
NEWTYPE.gtlv_item
pad.w
text$
End NEWTYPE
Dim List dummy.gtlv_item(10)
foo.l=GTListView(0,1,20,20,200,150,"Items",#PLACETEXT_ABOVE,dummy())
NPrint Hex$(foo)
GTButton 0,2,20,170,200,15,"Add item",#PLACETEXT_IN
AddIDCMP #LISTVIEWIDCMP|BUTTONIDCMP
Window 0,0,0,600,300,$100f,"jjlk",-1,-1
DefaultOutput
CatchDosErrs
AttachGTList 0,0
While ev.l<>#IDCMP_CLOSEWINDOW
ev.l=WaitEvent
Select ev
Case #IDCMP_GADGETUP
If GadgetHit=2
; Before changing the actual contents of the list being displayed in
; a listview gadget, you must detach it from the listview gadget.
; This is done like this:
GTChangeList 0,1
; Now we are free to change the list
If AddLast(dummy())
dummy()\text = String$(Chr$(Rnd(26)+65),5+Rnd(5))
Else
foo.l=RTEZRequest("GTChangeList example","Cannot add any more items to list - it's full!","OK")
EndIf
; Finally, we can attach the list back onto the listview gadget
GTChangeList 0,1,dummy()
EndIf
End Select
Wend
DetachGTList 0
End